/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package audio;

import boot.MainBoot;
import com.jme3.audio.AudioNode;

/**
 * sounds for the game.
 * @author adamgovan
 */
public class WeaponSound {

    AudioNode audio_pistol;

    public void initAudio() {
        /* gun shot sound is to be triggered by a mouse click. */
        audio_pistol = new AudioNode(MainBoot.getMain().getAssetManager(), "Sound/Effects/Gun.wav");
        audio_pistol.setLooping(false);
        audio_pistol.setVolume(2);
//        /* nature sound - keeps playing in a loop. */
//        audio_nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg");
//        audio_nature.setLooping(true);
//        audio_nature.setPositional(true);
//        audio_nature.setLocalTranslation(Vector3f.ZERO.clone());
//        audio_nature.setVolume(3);
//        audioRenderer.playSource(audio_nature); // play continuously!
    }

    public void playWeapon(String sound) {
        if (sound.equalsIgnoreCase("pistol")) {
            MainBoot.getMain().getAudioRenderer().playSource(audio_pistol);
        }

    }
}
